
package DTO;

/**
 * This class acts as data transfer abstraction for promotion object attributes. It encapsulates address attributes.
 * This object is transferred back and forth amongst various layers.
 * @author tejinder
 * @see DTO
 */
public class Promotion {

    private int id;
    private String name;
    private String startDate;
    private String endDate;
    private double amount;
    private boolean storeCardReq;

    /**
     * default constructor
     */
    public Promotion() {
        id = 0;
        name = "";
        startDate = "";
        endDate = "";
        amount = 0.00;
        storeCardReq = false;
    }

    /**
     * parameterized constructor
     * @param prid integer promotion id
     * @param promotionName string promotion name
     * @param startDate string start date of promotion
     * @param endDate string end date for promotion
     * @param amount double
     * @param storeCardReq  boolean
     */
    public Promotion(int prid, String promotionName, String startDate,
            String endDate, double amount, boolean storeCardReq) {
        this.id = prid;
        this.name = promotionName;
        this.startDate = startDate;
        this.endDate = endDate;
        this.amount = amount;
        this.storeCardReq = storeCardReq;
    }

  /**
   * gets promotion id
   * @return
   */
    public int getID() {
        return this.id;
    }

    /**
     * gets promotion name
     * @return
     */
    public String getName() {
        return this.name;
    }
/**
 * sets promotion name
 * @param name
 */
    public void setName(String name) {
        this.name = name;
    }
    /**
     * gets start date
     * @return
     */
    public String getStartDate() {
        return this.startDate;
    }
    /**
     * sets start date
     * @param date
     */
    public void setStartDate(String date) {
        startDate = date;
    }
    /**
     * gets end date
     * @return
     */
    public String getEndDate() {
        return this.endDate;
    }
    /**
     * sets end date
     * @param date
     */
    public void setEndDate(String date) {
        endDate = date;
    }
    /**
     * gets amount
     * @return
     */
    public double getAmount() {
        return this.amount;
    }
    /**
     * sets amount
     * @param amount
     */
    public void setAmount(double amount) {
        this.amount = amount;
    }
    /**
     * is store card required
     * @return boolean
     */
    public boolean isStoreCardReq() {
        return this.storeCardReq;
    }
    /**
     * sets to true or false
     * @param value
     */
    public void setStoreCardReq(boolean value) {
        this.storeCardReq = value;
    }
   /**
     * toString() method overrides the default behavior of Object class toString() method.
     * @return  a string representing the state of object
     */
    @Override
    public String toString() {
        return "Promo: " + this.name + "\n" + "Start: " + this.startDate + "\n" +
                "End: " + this.endDate + "\n" + "Amount: " + this.amount + "\n" +
                "SC Require: " + storeCardReq;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }
}
